package com.crape.common.enums;

public enum ArticleIndexType {

    flash(1), left(2), right(3), notrecommend(-1);

    private int code;

    ArticleIndexType(int code){
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static ArticleIndexType valueOf(int code) {
        for (ArticleIndexType type : values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid type [" + code + "]");
    }
}
